﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Navigation;
using System.Windows.Media.Imaging;
using Microsoft.Phone.Tasks;
using Microsoft.Advertising.Mobile.UI;
using Common.Library;
using Common.Utilities;


namespace CommonControls
{
    public partial class ContactUs : PhoneApplicationPage
    {
        public ContactUs()
        {
            InitializeComponent();

          
            Loaded += new RoutedEventHandler(ContactUs_Loaded);
        }

        private void LoadAds()
        {
            try
            {
                PageHelper.LoadAdControl(ContGrid, AdContainer, 2);
            }
            catch (Exception ex)
            {
                Exceptions.SaveOrSendExceptions("Exception in LoadAds Method In SongDetails file", ex);
                string excepmess = "Exception in LoadAds Method In SongDetails file.\n\n" + ex.Message + "\n\n StackTrace :- \n" + ex.StackTrace;
            }

        }

        void ContactUs_Loaded(object sender, RoutedEventArgs e)
        {
            if (ResourceHelper.AppName != Apps.Indian_Cinema_Pro.ToString() && ResourceHelper.AppName != Apps.Kids_TV_Pro.ToString() && ResourceHelper.AppName != Apps.Story_Time_Pro.ToString())
                LoadAds();
        }

        private void facebookImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            fb_Click(sender, e);
        }

        private void twitter_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            tw_Click(sender, e);
        }

        private void blogger_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            bg_Click(sender, e);
        }

        private void youtube_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            yt_Click(sender, e);
        }

        private void yt_Click(object sender, MouseButtonEventArgs e)
        {
            UtilitiesManager.LoadBrowserTaskToSocialNetwork(Constants.CompanyYoutubePageUrl);
        }

        private void bg_Click(object sender, MouseButtonEventArgs e)
        {
            UtilitiesManager.LoadBrowserTaskToSocialNetwork(Constants.CompanyBlogPageUrl);
        }

        private void tw_Click(object sender, MouseButtonEventArgs e)
        {
            UtilitiesManager.LoadBrowserTaskToSocialNetwork(Constants.CompanyTwitterPageUrl);
        }

        private void fb_Click(object sender, MouseButtonEventArgs e)
        {
            UtilitiesManager.LoadBrowserTaskToSocialNetwork(Constants.CompanyFacebookPageUrl);
        }

        private void SendFeedback_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            sfb_Click(sender, e);
        }

        private void sfb_Click(object sender, MouseButtonEventArgs e)
        {
            Page page = PageHelper.GetDependencyObjectFromVisualTree(this, typeof(Page)) as Page;
            page.NavigationService.Navigate(UtilitiesResources.FeedbackPage);
        }

        private void imgTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(UtilitiesResources.MainPageUri);
        }

    }
}